<template>
    <div class="user-box">
      <div class="left">
        <div class="hedar">
          <div><img :src="this.$store.state.user.photo" ></div>
          <div>{{this.$store.state.user.nickName}}</div>
          <div>ID：{{this.$store.state.user.uid}}</div>
        </div>
        <ul>
          <router-link tag='li' exact :to="{path:'/user'}"><span class="iconfont icon-wode"></span>个人中心</router-link>
          <router-link tag='li' to="/mybackpack"><span class="iconfont f24 icon-icon_beibao mgr0"></span>我的背包</router-link>
          <router-link tag='li' to="/accountrechargerecords"><span class="iconfont f20 icon-bijibenjilutongxunlu"></span>账户记录</router-link>
          <router-link tag='li' to="/accountrecharge"><span class="iconfont f20 icon-chongzhijiaofei"></span>账户充值</router-link>
          <router-link tag='li' to="/Share"><span class="iconfont f20 icon-fenxiang"></span>好友分享</router-link>
        </ul>
      </div>
      <div class="right">
        <router-view></router-view>
      </div>
    </div>
</template>

<script>
export default {
 data () {
    return {

    }
  },
  methods: {

  },
  created() {
    // this.$route.params.id;
    // console.log( this.$route.params.id)
    var token = window.localStorage.getItem('token');
    if(!token){
      this.$router.push({
        path: `/Homes`,
      })
    }
  }
}
</script>

<style scoped>
  .mgr0{
    margin-right: 1px !important;
    margin-left: -3px;
  }
  .f24{
    font-size: 26px !important;
  }
  .f20{
    font-size: 20px !important;
  }
  .iconfont{
    margin-right: 5px;
    font-size: 16px;
  }
  .user-box{
    width: 1300px;
    margin: 10px auto;
    padding: 0 50px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
  }
  .user-box .left{
    width: 184px;
     background-color: rgba(11, 15, 22, .74);
  }
  .user-box .left .activ{
    color: #FFFFFF;
    background-color: #1A4464;
  }
  .user-box .right{
    width: 1008px;
    background-color: rgba(11, 15, 22, .74);
  }
  .user-box .hedar{
    padding: 29px;
    box-sizing: border-box;
  }
  .user-box .hedar>div:first-child{
    border: 2px solid #4169A6;
    border-radius: 50%;
    width: 69px;
    height: 69px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
  }
  .user-box .hedar>div:first-child img{
   /* position: absolute;
   top: 50%;
   left: 50%;
   width: auto;
   height: auto;
   max-width: 67px;
   max-height: 67px;
   transform: translate(-50%, -50%); */
   width: 100%;
   height: 100%;
  }
  .user-box .hedar>div:nth-child(2){
    color: #FFFFFF;
    font-size: 14px;
    margin-top: 17px;
    line-height: 14px;
  }
  .user-box .hedar>div:nth-child(3){
    color: #999999;
    font-size: 12px;
    margin-top: 8px;
    line-height: 10px;
  }
  .user-box .left ul{
    width: 100%;
    margin-top: 33px;
    color: #039CC8;
  }
  .user-box .left ul li{
    height: 63px;
    width: 100%;
    line-height: 63px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
  }
  .user-box .left ul li:hover{
    color: #FFFFFF;
    background-color: #1A4464;
    opacity: .8;
  }
</style>
